package com.itheima.duotai4;

public class Test {

    public static void main(String[] args) {
      /*  Zi1 zi1 = new Zi1();
        zi1.sing();
        Zi2 zi2 = new Zi2();
        zi2.sing();*///接口的好处

        Fu fu= new Zi1();
        fu.sing();


    }
}

interface Fu {
    void sing();
}

class Zi1 implements Fu {
    @Override
    public void sing() {
        System.out.println("子2 的sing");//开闭原则
    }
}
class Zi2 implements Fu {
    @Override
    public void sing() {
        System.out.println("子2 的sing");
    }
}